//1.0导入vue核心包
import Vue from 'vue';

//2.0导入App组件
import App from './App.vue';

//3.0利用vue-router集成到项目来
import vueRouter from 'vue-router';

//3.1将VueRouter对象绑定到vue对象上
Vue.use(vueRouter);

import home from './components/Home.vue';
import shopcar from './components/shopcar/car.vue';
import newslist from './components/news/newslist.vue';
import newsinfo from './components/news/newsinfo.vue';
import photolist from './components/photo/photolist.vue';
import photoinfo from './components/photo/photoinfo.vue';
import goodslist from './components/goods/goodslist.vue';
import goodsinfo from './components/goods/goodsinfo.vue';
import goodsdesc from './components/goods/goodsdesc.vue';
import goodscomment from './components/goods/goodscomment.vue';
import car from './components/shopcar/car.vue';
//3.2定义路由规则
var router1 = new vueRouter({
	linkActiveClass: 'mui-active',	//改变路由激活时的class名称。
	routes: [
		{
			path:'/',redirect:'/home'
		},
		{
			path: '/home',
			component: home
		},
		{
			path: '/shopcar',
			component: shopcar
		},
		{
			path: '/news/newslist',
			component:newslist
		},
		{
			path: '/news/newsinfo/:id',
			component:newsinfo
		},
		{
			path: '/photo/photolist',
			component:photolist
		},
		{
			path:'/photo/photoinfo/:id',
			component:photoinfo
		},
		{
			path:'/goods/goodslist/',
			component:goodslist
		},
		{
			path:'/goods/goodsinfo/:id',
			component:goodsinfo
		},
		{
			path:'/goods/goodsdesc/:id',
			component:goodsdesc
		},
		{
			path:'/goods/goodscomment/:id',
			component:goodscomment
		},
		{
			path:'/shopcar/car',
			component:car
		}
	]
});

//4.0注册mint-ui
//导入css文件
import 'mint-ui/lib/style.min.css';

import mint from 'mint-ui';
Vue.use(mint);

//5.0注册miude css的样式
import '../statics/mui/css/mui.css';

//6.0导入一个当前系统的全局基本样式
import '../statics/css/site.css';

//7.0将vue-resource在vue中绑定

import vueResource from 'vue-resource';

Vue.use(vueResource);

//8.0定义一个全局的过滤器实现日期g格式化
import moment from 'moment';
Vue.filter('datefmt', function (input,fmtstring) {
	return moment(input).format(fmtstring);
})

//9.0使用Vue对象进行解析渲染
import VuePreview from 'vue-preview';
Vue.use(VuePreview);


new Vue({
	el: "#app",
	//使用路由对象实例,
	router:router1,
	render: c => c(App)
})